<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace app\cpmjagent\controller;

/**
 * Description of AppbaseController
 *
 * @author SoChishun
 */
class AppbaseController extends \think\Controller {

    /**
     * userid, account, isadmin
     * @var type 
     */
    protected $global_data = [];

    protected function _initialize() {
        parent::_initialize();
        $loginInfo = \think\Session::get(\think\Config::get('login_sessid'));
        if (!$loginInfo) {
            $this->redirect('login/index');
            exit;
        }
        $loginInfo['isadmin']=in_array($loginInfo['account'], \think\Config::get('admins'));
        $this->global_data = $loginInfo;
    }

}
